<template>
  <div v-show="header.opened" class="container-layer-header">
    <div class="item-header">
      <span v-if="header.canBack" class="item-arrow-left" @click="$router.back()">
        <van-icon name="arrow-left" />
      </span>
      <!-- <img v-if="header.canBack" src="@/assets/exit.png" @click="$router.back()"> -->
      <span class="title">{{ header.title }}</span>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters(['header'])
  }
}
</script>

<style lang="less" scoped>
.container-layer-header {
  height: 45px;
  .item-header {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    position: fixed;
    top: 0;
    z-index: 748943649;
    display: flex;
    align-items: center;
    background-color: #d63a54;
  }
  .title {
    margin-left: 15px;
    color: #fff;
  }
  .item-arrow-left {
    position: relative;
    top: 2px;
  }
  span {
    color: #fff;
  }
}
</style>
